<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div ng-controller="Ctrl">
		<drink flavor="{{ctrlFlavor}}"></drink>
	</div>

	<script src="angular.js"></script>
	<script type="text/javascript">
		var module = angular.module("app", []);

		module.controller("Ctrl", function($scope) {
			$scope.ctrlFlavor = "百威";
		});

		module.directive("drink", function() {
			return {
				restrict: "E",
				template: "<div>{{flavor}}</div>",
				scope: {
					flavor: "@"
				}
				// link: function(scope, element, attrs) {
				// 	scope.flavor = attrs.flavor;
				// }
			}
		});


	</script>
</body>
</html>